package coreservlets;

public class EmployeeBean {
  private NameBean name;
  private CompanyBean company;

  public EmployeeBean(NameBean name, CompanyBean company) {
    setName(name);
    setCompany(company);
  }

  public EmployeeBean() {
    this(new NameBean("Marty", "Hall"),
         new CompanyBean("coreservlets.com",
                         "J2EE Training and Consulting"));
  }

  public NameBean getName() { return(name); }

  public void setName(NameBean newName) {
    name = newName;
  }

  public CompanyBean getCompany() { return(company); }

  public void setCompany(CompanyBean newCompany) {
    company = newCompany;
  }

  public String processEmployee() {
    if (Math.random() < 0.5) {
      return("accept");
    } else {
      return("reject");
    }
  }
}